


target("ar8030_client")
    if get_config('APP_STATIC_LIB') == true then
        set_kind("static")
    else
        set_kind("shared")
    end

    add_deps("com")
    add_files("bb_dev.c")
    add_files("session_ioctl.c")
    add_files("socket.c")
    add_files("session_callback.c")
    add_files("ar8030.c")
    add_files("session.c")
    add_files("socket_fd.c")
    add_files("session_debug.c")
    add_files("session_socket.c")
    add_files("session_socket_datagram_ext.c")
    add_files("session_hotplug.c")
    add_files("undefined_fun.c")

    if get_config('target_os') == "linux" or is_plat("linux", "android") then
        add_cxflags("-fPIC")
        add_files("socket_linux.c")
    elseif is_plat("windows") then 
        add_files("socket_win.c")
        add_links("Ws2_32.lib")
    end

    on_install(function (target)
        local libpath = path.join(target:installdir() , "lib")
        dhpath = path.join(target:installdir() , "dev_helper")

        os.mkdir(dhpath)
        os.mkdir(libpath)

        os.cp(target:targetfile() , libpath)
        if get_config('APP_STATIC_LIB') == false then
            os.cp(target:targetfile() , dhpath)
        end
    end)
